<template>
	<view class="index">
		<index-background v-if="pageData['theme']" :theData="pageData['theme']"></index-background>
		<head-section v-if="pageData['head']" position="fixed" :page-scroll="pageScroll"></head-section>
		<index-swiper v-if="pageData['swiper']" :theData="pageData['swiper']"></index-swiper>
		<index-category v-if="pageData['category']" :theData="pageData['category']"></index-category>
		<index-banner v-if="pageData['banner']" :theData="pageData['banner']"></index-banner>
		<index-goods v-if="pageData['goods']" :theData="pageData['goods']"></index-goods>
	</view>
</template>

<script>
	import IndexBackground from '../../components/index/IndexBackground.vue'
	import headSection from '../../components/headSection.vue'
	import IndexSwiper from '../../components/index/IndexSwiper.vue'
	import IndexCategory from '../../components/index/IndexCategory.vue'
	import IndexBanner from '../../components/index/IndexBanner.vue'
	import IndexGoods from '../../components/index/IndexGoods.vue'
	
	export default {
		name: 'index',
		components: {
			IndexBackground,
			headSection,
			IndexSwiper,
			IndexCategory,
			IndexBanner,
			IndexGoods
		},
		data() {
			return {
				pageScroll: {},
				pageData: {},
			}
		},
		onPageScroll(e) {
			this.pageScroll = e;
		},
		onLoad(e) {
			this.$api.marketing.getIndexSetting((res) => {
				this.pageData = res.data;
			})
		},
		methods: {
		}
	}
</script>

<style lang="scss">
	.index {
	}
</style>
